/**
 * Created by walkman on 2017/6/23.
 */

(function () {
  angular.module('WfbPlatformApp').controller('TransferController',
    ['$rootScope', '$scope', '$http', '$compile', 'http', '$q',
      function ($rootScope, $scope, $http, $compile, http, $q) {

        $scope.$on('$viewContentLoaded', function () {
          // initialize core components
        });

        $scope.$on('$includeContentLoaded', function () {

        });

        $(function () {
          $("*[name='pay_pwd']").focus(function () {
            $(this).attr('type', 'password');
          })
          $('#jax').bind('click', grio);

          // $('#username').bind('onblur',checkMember)
          function grio() {
            $('body').mLoading('show');
            $.post('', {
              username: $('#username').val(),
              pay_pwd: $('#pay_pwd').val(),
              style: $('#style').val(),
              money: $('#money').val()
            }, function (data) {

              if (data.code == 1) {
                $('body').mLoading('hide');
                success(data.msg, function () {
                  location.href = "";
                })
              } else {
                $('body').mLoading('hide');
                error(data.msg, function () {
                })
              }
            })
          }
        })

        function scheckMember() {
          console.log(1);
          $('#errorMessage').css('display', 'none');
          $.post('/account/check',
            {
              username: $('#username').val()
            },
            function (data) {

              $('#errorMessage').html(data.data)
              $('#errorMessage').css('display', '');
            })

        }


      }]);
})();
